import java.util.Random;
import java.util.Scanner;

public class java011 {
    public static void main(String[] args){
    Student[] students=new Student[3];
    addStudent(students);
    printStudent(students);
    System.out.println("幸运儿是"+randomStudent(students));
    }
    //----------------------------------------------------
    public static void addStudent(Student[] s){
        Scanner scanner=new Scanner(System.in);
        for(int i=0;i< s.length;i++){
            Student a=new Student();
            System.out.println("输入");
            a.name= scanner.next();
            a.age= scanner.nextInt();
            a.id=i+1;
            s[i]=a;
        }
    }
    //-------------------------------------------------
    public static void printStudent(Student[] s){
        for(int i=0;i< s.length;i++){

            System.out.println(s[i].name+s[i].age+s[i].id);
        }
    }
    public  static String randomStudent(Student[] s){
        int index=new Random().nextInt(3);
        return s[index].name;
    }
    //-----------------------------------------------------
    public static boolean exist(int[] arr,int n){
        int m=0;
        for(int i=0;i< arr.length;i++){
            if(arr[i]==n){
              m++;
            }
        }
        if(m==0){
            return true;
        }else {
            return false;
        }
    }
    //-----------------------------------------------------
    public static int[] copyarr(int[] arr,int a,int b){
        int[] arr1=new int[b-a];
        for(int i=0;i<arr1.length;i++){
            arr1[i]=arr[a];
            a++;
        }
        return arr1;
    }
}
